const useTransitions = () => {
  const supportTransisionName = {
    fade: "fade", // 淡入淡出
    scale: "scale", // 缩放
    zoom: "zoom", // 缩放
    slide: "slide", // 滑动
    // rotate: "rotate", // 旋转
    flip: "flip", // 翻转
    push: "push", // 推入
    bounce: "bounce", // 弹跳
    random: "random", // 随机
  }
  function getRandomName() {
    // 随机获取一个过渡动画名称 排除  RANDOM
    const names = Object.keys(supportTransisionName).filter(
      (name) => name !== "RANDOM" && name !== "getRandomName"
    );
    return names[Math.floor(Math.random() * names.length)];
  }

  return { supportTransisionName, getRandomName };
}

export default useTransitions;